package com.whfc.mach.dao;

import com.whfc.mach.dto.warn.AppWarnTimeDTO;
import com.whfc.mach.entity.AppMachWarnRuleTime;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppMachWarnRuleTimeMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppMachWarnRuleTime record);

    int insertSelective(AppMachWarnRuleTime record);

    AppMachWarnRuleTime selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppMachWarnRuleTime record);

    int updateByPrimaryKey(AppMachWarnRuleTime record);

    /**
     * 根据规则id查找
     *
     * @param ruleId
     * @return
     */
    List<AppWarnTimeDTO> selectByRuleId(@Param("ruleId") Integer ruleId);

    /**
     * 根据报警规则id删除
     *
     * @param ruleId
     */
    void deleteByRuleId(@Param("ruleId") Integer ruleId);

    /**
     * 批量添加
     *
     * @param timeList
     */
    void batchInsert(@Param("timeList") List<AppWarnTimeDTO> timeList);
}